<%--
  Created by IntelliJ IDEA.
  User: HELLO
  Date: 2019/12/12
  Time: 14:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <script src="../static/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/static/js/jquery-1.9.1.js" type="text/javascript"></script>
</head>
<body>
<div class="container text-center">
    <form role="form" action="/detail/toLogin" method="get">
        新闻分类:
        <c:if test="${categoryId=='0'}">
            <select class="text-center" name="categoryId">
                <option value="0" selected="selected">全部</option>
                <option value="1">军事</option>
                <option value="2">国内</option>
                <option value="3">国际</option>
            </select>
        </c:if>
        <c:if test="${categoryId=='1'}">
            <select class="text-center" name="categoryId">
                <option value="0">全部</option>
                <option value="1" selected="selected">军事</option>
                <option value="2">国内</option>
                <option value="3">国际</option>
            </select>
        </c:if>
        <c:if test="${categoryId=='2'}">
            <select class="text-center" name="categoryId">
                <option value="0">全部</option>
                <option value="1">军事</option>
                <option value="2" selected="selected">国内</option>
                <option value="3">国际</option>
            </select>
        </c:if>
        <c:if test="${categoryId=='3'}">
            <select class="text-center" name="categoryId">
                <option value="0">全部</option>
                <option value="1">军事</option>
                <option value="2">国内</option>
                <option value="3" selected="selected">国际</option>
            </select>
        </c:if>
        新闻标题:
        <input type="text" class="text-center" name="title" value="${title}">
        <input type="submit" class="btn btn-danger" value="查询">
    </form>
    <table class="table">
        <caption class="text-center"><h1>新闻列表</h1></caption>
        <thead>
        <tr>
            <th>新闻编号</th>
            <th>新闻标题</th>
            <th>新闻摘要</th>
            <th>作者</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach var="w" items="${list}">
            <tr>
                <td>${w.id}</td>
                <td>${w.title}</td>
                <td>${w.summary}</td>
                <td>${w.author}</td>
                <td><fmt:formatDate value="${w.createDate}" pattern="yyyy-MM-dd"/></td>

                <td>
                    <a href="/detail/ToUpdate.do?id=${w.id}" class="btn btn-info">修改</a>&nbsp;
                </td>
            </tr>
        </c:forEach>

        </tbody>
    </table>
</div>
</body>
</html>
